//
//  ReadListCell.m
//  liang ping
//
//  Created by lanou on 16/3/12.
//  Copyright © 2016年 孙金龙. All rights reserved.
//

#import "ReadListCell.h"
#import "UIImageView+WebCache.h"
@implementation ReadListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 25, KWidth-40, 50)];
        _titleLabel.font = [UIFont systemFontOfSize:22];
        _titleLabel.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_titleLabel];
        
        _imageview = [[UIImageView alloc] initWithFrame:CGRectMake(20, 92, (KWidth-100)/2, 95)];
        _imageview.backgroundColor = [UIColor lightGrayColor];
        [self.contentView addSubview:_imageview];
        
        _detaliLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 92, (KWidth)/2, 95)];
        _detaliLabel.font = [UIFont systemFontOfSize:11];
        _detaliLabel.textColor = [UIColor lightGrayColor];
        _detaliLabel.backgroundColor = [UIColor whiteColor];
        _detaliLabel.numberOfLines = 0;
        [self.contentView addSubview:_detaliLabel];
    }
    return self;
}

- (void)setModel:(ProductModel *)model
{
    _titleLabel.text = model.title;
    [_imageview sd_setImageWithURL:[NSURL URLWithString:model.coverimg]];
    _detaliLabel.text = model.content;
}


- (void)awakeFromNib {
  
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
